import Vue from 'vue'
import VueRouter from 'vue-router'

import login from '@/views/user/login.vue'
import home from '@/views/home/home.vue'
import movie from '@/views/movie/movie.vue'
import user from '@/views/user/user.vue'
import qa from '@/views/qa/qa.vue'
import notfound from '@/views/notfound/notfound.vue'
import layout from '@/views/layout.vue'

Vue.use(VueRouter)


const routes = [{
        name: '/login',
        path: '/login',
        component: login
    },
    {
        name: '/notfound',
        path: '/notfound',
        component: notfound
    },
    {
        path: '*',
        redirect: '/notfound'
    },
    {
        name: '/layout',
        path: '/',
        component: layout,
        children: [{
                name: '/home',
                path: '/home',
                component: home
            },
            {
                name: '/qa',
                path: '/qa',
                component: qa
            },
            {
                name: '/user',
                path: '/user',
                component: user
            },
            {
                name: '/movie',
                path: '/movie',
                component: movie
            },
            {
                path: '/',
                redirect: '/home'
            },

        ]
    },

]

const router = new VueRouter({
    routes
})

export default router